package parallelism;

import java.util.concurrent.Callable;

import fitness.FastStrongOscillatorFitness;

import model.OligoSystemGeneral;

import optimizers.simplega.Individual;

public class OligoSystemGeneralFitnessEvaluationTask implements Callable {
	private int i;
	private int j;
	private int k;
	private OligoSystemGeneral oligoModel;

	public OligoSystemGeneralFitnessEvaluationTask(int i, int j, int k,
			OligoSystemGeneral oligoModel) {
		this.i = i;
		this.j = j;
		this.k = k;
		this.oligoModel = oligoModel;
	}

	public Object call() {
		long startTime = System.currentTimeMillis();
		fitness.FitnessResult result = new FastStrongOscillatorFitness()
				.evaluateFitness(this.oligoModel);
		double estimatedTime = ((double) System.currentTimeMillis() - startTime) / 1000;
		return new OligoSystemGeneralFitness(i, j, k, result, estimatedTime);
	}
}